package com.shuoyue.ycgk.ui.mine.wrong.infos2;

import android.content.Context;
import android.content.Intent;

import com.shuoyue.ycgk.entity.ChapterType;
import com.shuoyue.ycgk.entity.QuestionParent;
import com.shuoyue.ycgk.entity.SectionType;
import com.shuoyue.ycgk.ui.mine.wrong.WrongContract;
import com.shuoyue.ycgk.ui.questionbank.base.BaseQuestionActivity;
import com.shuoyue.ycgk.views.dialog.common.HintConfirmDialog;

import java.util.List;

public class QuestionWrongActivity extends BaseQuestionActivity
        implements WrongContract.View {

    WrongContract.Presenter spePresenter;

    int sectionId;
    int type;
    String pagerName;


    public static void start(Context source,
                             int sectionId,
                             int type,
                             String name) {
        source.startActivity(new Intent(source, QuestionWrongActivity.class)
                .putExtra("sectionId", sectionId)
                .putExtra("type", type)
                .putExtra("epName", name)
        );
    }


    @Override
    public Class getClassT() {
        return WrongInfoMateriFragment.class;
    }

    @Override
    public Class getClassK() {
        return WrongInfoSimpleFragment.class;
    }

    @Override
    protected void initView() {
        super.initView();
        pagerName = getIntent().getStringExtra("epName");
        name.setText(pagerName);
    }


    @Override
    public void initData() {
        super.initData();
        sectionId = getIntent().getIntExtra("sectionId", -1);
        type = getIntent().getIntExtra("type", -1);
        spePresenter = new WrongContract.Presenter();
        spePresenter.attachView(this);
        spePresenter.getWrongQuestions(sectionId, type);
    }

    @Override
    public void lastOne() {
//        finish();
    }

    @Override
    public void back() {
        HintConfirmDialog hintConfirmDialog = new HintConfirmDialog(mContext,
                "提示",
                "是否退出");
        hintConfirmDialog.setOkListener(v -> finish());
        hintConfirmDialog.show();
    }


    @Override
    public void setTypeList(List<ChapterType> chapterSectionTypes) {

    }

    @Override
    public void setQuestions(List<QuestionParent> questionList) {
        setThisActData(questionList);
    }

    @Override
    public void clearSuc() {

    }

    @Override
    public void deleted(ChapterType chapter, SectionType sectionType) {

    }



    @Override
    public void changeStatue(int statue) {

    }
}
